#ifndef PID_H_
#define PID_H_

//include
#include "zf_common_typedef.h"

typedef enum
{
    first = 0,
    other,
}pid_run_flag;

struct PID_parameters
{
       pid_run_flag run_flag;
       float error;
       float i_error;
       float last_error;
       float last_2_error;
       float kp;
       float ki;
       float kd;
       float max_kp_product;
       float max_ki_product;
       float max_kd_product;
       float max_pid_sum;
       float pid_sum;
};
void local_pid(struct PID_parameters *self,float target,float current);
void inc_pid(struct PID_parameters *self,float target,float current);


#endif